<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'basic';
$return=array();
/*******basic*******/
if($_RQ['op']=='basic'){
	if($_RQ['postdata']){
		$postdata=get_postdata();
		if(!$postdata['service_agent_path'] || !$postdata['service_agent_phone'] || !$postdata['service_agent_type'] || !$postdata['receiver_name'] || !$postdata['detailed_address'] || !$postdata['tel_number'] || !$postdata['country'] || !$postdata['pcd']){
			exi('请完善所有信息！','error');
		}
		$item=$this->model('wxapp_api')->update_info($postdata);
		$this->plugin_setting('updateinfo',$postdata);
		exi('更新成功');
	}
	$return['item']=$this->plugin_setting('updateinfo');
	$tip ='<red>【完成开通《交易组件》任务】：</red>';
	$tip .='</br>提示“该账号客服方式必须包含小程序客服”：1 ,需要在微信小程序MP后台配置微信客服；2、填写本页面，更新商家信息！';
	$htmls=array(
		'type'=>'edit',
		'desc'=>'更新商家信息',
		'edit_tab'=>true,
		'edits'=>array(
			array(
				'title'=>'商家信息',
				'list'=>array(
						array('type'=>'tip','title'=>$tip),
						array('type'=>'string','title'=>'小程序路径path','name'=>'service_agent_path','help'=>'例如：/jy_weishop/index/index'),
						array('type'=>'string','title'=>'客服联系方式','name'=>'service_agent_phone','help'=>''),
						array('type'=>'checkbox','title'=>'客服类型','name'=>'service_agent_type','options'=>'service_agent_type'),
						array('type'=>'string','title'=>'自定义客服路径','name'=>'kefu_path','help'=>''),
						array('type'=>'string','title'=>'退货:收件人姓名','name'=>'receiver_name','help'=>''),
						array('type'=>'string','title'=>'退货:收件人手机号码','name'=>'tel_number','help'=>''),
						array('type'=>'string','title'=>'退货:国家','name'=>'country','help'=>''),
						array('type'=>'pcd','title'=>'退货:区域','name'=>'pcd','help'=>''),
						array('type'=>'string','title'=>'退货:详细收货地址信息','name'=>'detailed_address','help'=>''),
				)
			),
		),
	);
	$return['service_agent_type']=$this->service_agent_type;
	$return['htmls']=$htmls;
	exi($return);
}
/*******basic*******/
/*******op*******/
